
//初始化数据
function tabbarinit() {
  return [
     {
        "current": 0,
        "pagePath": "/pages/car/index/index",
        "iconPath": "/images/index.png",
        "selectedIconPath": "/images/index-active.png",
        "text": "首页"
    },    
    {
        "current": 0,
        "pagePath": "/pages/car/message/message",
        "iconPath": "/images/message.png",
        "selectedIconPath": "/images/message-active.png",
        "text": "资讯"
    },
    {
        "current": 0,
        "pagePath": "/pages/car/mine/mine",
        "iconPath": "/images/mine.png",
        "selectedIconPath": "/images/mine-active.png",
        "text": "我的"  
    }
  
  ]

}
//tabbar 主入口
function tabbarmain(bindName = "tabdata", id, target) {
  var that = target;
  var bindData = {};
  var otabbar = tabbarinit();
  otabbar[id]['iconPath'] = otabbar[id]['selectedIconPath']//换当前的icon
  otabbar[id]['current'] = 1;
  bindData[bindName] = otabbar
  that.setData({ bindData });
}

module.exports = {
  tabbar: tabbarmain
}